﻿@using Yelper.Web
@model User

@{
    ViewBag.Title = "New user";
}

<h1>I am new here!</h1>

@if (ViewData["succes"] == null || (bool)ViewData["succes"] == false) {

    using (Html.BeginForm()) {

    <div class="FormItem">
        <div class="FieldInfo">
            @Html.LabelFor(x => x.Username)
        </div>
        <div class="Field">
            @Html.TextBoxFor(x => x.Username)
            @Html.ValidationMessageFor(x => x.Username)
        </div>    
    </div>

    <div class="FormItem">
        <div class="FieldInfo">
            @Html.LabelFor(x => x.FullName)
        </div>
        <div class="Field">
            @Html.TextBoxFor(x => x.FullName)
            @Html.ValidationMessageFor(x => x.FullName)
        </div>
    </div>
    
    <div class="FormItem">
        <div class="FieldInfo">
            @Html.LabelFor(x => x.Email)
        </div>
        <div class="Field">
            @Html.TextBoxFor(x => x.Email)
            @Html.ValidationMessageFor(x => x.Email)
        </div>
    </div>

    <div class="FormItem">
        <div class="FieldInfo">
            @Html.LabelFor(x => x.PlainTextPassword)
        </div>
        <div class="Field">
            @Html.PasswordFor(x => x.PlainTextPassword)
            @Html.ValidationMessageFor(x => x.PlainTextPassword)
        </div>
    </div>
    
    <div class="FormItem">
        <div class="FieldInfo">
            @Html.LabelFor(x => x.ConfirmPlainTextPassword)
        </div>
        <div class="Field">
            @Html.PasswordFor(x => x.ConfirmPlainTextPassword)
            @Html.ValidationMessageFor(x => x.ConfirmPlainTextPassword)
        </div>
    </div>

    <div class="FormButton">
        <input type="submit" value="Create my account" />
    </div>
     
    }
    
} else { 

    <p>Thank you for registering! A confirmation mail with further instructions was sent.</p>

}